<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script src="js/jquery.js"></script>
<title>Insert title here</title>
</head>
<body>
	<form action="MyServlet" method="post" name="">
		<input type="text" name="userName" />
		<input type="submit" name="submit" value="提交按钮"/>
	</form>
	 <input type="button"    onClick="show()" id="send"  style="width:100px;" value="注册用户"> 
   
	<%
		//获取request中msg属性存储的数据，
		String responseMsg = (String)request.getAttribute("msg");
		//判断是否为null，因为第一次直接访问该jsp，没有该属性，属性为null；只有不为null时才显示该信息
		if(responseMsg != null){
			out.println(responseMsg);
		}
	%>
	<script type="text/javascript">
	         function show(){
	        	 alert("chul");
	                	//校验成功保存
	                	 jQuery.ajax({
	 						type:"POST",
	 					 	url:"user/showUser", 
	 					 	data:"email=1" ,
	 						success:function(data){
	 							alert("ddd");
	 							alert(data);
	 							},
	 							complete:function(){
	 								alert("eee");
	 							}
	 					 	});
	        	 
	        	
	         }
	   
	</script>
</body>
</html>